<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Contracts Management</title>
</head>
<body>

<h1>Contracts Management</h1>

<h2>Contract List</h2>
<table border="1">
    <tr>
        <th>Contract ID</th>
        <th>Contract Number</th>
        <th>Contract Name</th>
        <th>Supplier</th>
        <th>Amount</th>
        <th>Status</th>
        <th>Actions</th>
    </tr>
    <!-- Iterate over contracts and display each contract -->
    <c:forEach items="${contracts}" var="contract">
        <tr>
            <td>${contract.contractId}</td>
            <td>${contract.contractNumber}</td>
            <td>${contract.contractName}</td>
            <td>${contract.supplier}</td>
            <td>${contract.contractAmount}</td>
            <td>${contract.contractStatus}</td>
            <td>
                <!-- Links to update and delete contract actions -->
                <a href="updateContract.jsp?contractId=${contract.contractId}">Update</a>
                <a href="deleteContract.jsp?contractId=${contract.contractId}">Delete</a>
            </td>
        </tr>
    </c:forEach>
</table>

<h2>Create Contract</h2>
<form action="createContract" method="post">
    Contract Number: <input type="text" name="contractNumber"><br>
    Contract Name: <input type="text" name="contractName"><br>
    Supplier: <input type="text" name="supplier"><br>
    Amount: <input type="text" name="contractAmount"><br>
    Status: <input type="text" name="contractStatus"><br>
    <input type="submit" value="Create">
</form>

</body>
</html>